<p id="notice"><%= notice %></p>

<h1>Listing Houses</h1>

<table>
  <thead>
    <tr>
      <th>Street</th>
      <th>User</th>
      <th colspan="3"></th>
    </tr>
  </thead>

  <tbody>
    <% @houses.each do |house| %>
      <tr>
        <td><%= house.street %></td>
        <td><%= house.user %></td>
<% if authorized? :houses, :show, id: house.id  %>
        <td><%= link_to 'Show', house %></td>
<% end  %>
<% if authorized? :houses, :edit, id: house.id  %>
        <td><%= link_to 'Edit', edit_house_path(house) %></td>
<% end  %>
<% if authorized? :houses, :destroy, id: house.id  %>
        <td><%= link_to 'Destroy', house, method: :delete, data: { confirm: 'Are you sure?' } %></td>
<% end  %>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to 'New House', new_house_path if authorized? :houses, :new %>